import http from '@/http';

const url = '/api/UserSystem/contribution';

// 贡献管理  列表
export async function getContributionList(options = {}) {
  return await http.request('get', url, options).then(res => {
    if (!options.waitingMask) {
      http.tip(res);
    }
    return res;
  });
}
// 贡献管理  新增
export async function addContribution(options = {}) {
  return await http.request('post', url, options).then(res => {
    res.code == 200 && (res.message = '新增成功');
    if (!options.waitingMask) {
      http.tip(res);
    }
    return res;
  });
}
// 贡献管理  查看
export async function getContributionDetail(id, options = {}) {
  return await http.request('get', `${ url }/${ id }`, options).then(res => {
    if (!options.waitingMask) {
      http.tip(res);
    }
    return res;
  });
}
// 贡献管理  修改状态
export async function editContributionState(id, options = {}) {
  return await http.request('put', `${ url }/state/${ id }`, options).then(res => {
    if (!options.waitingMask) {
      http.tip(res);
    }
    return res;
  });
}
